package mc.support.taobao.api;

import com.taobao.api.TaobaoRequest;
import com.taobao.api.request.VasOrderSearchRequest;
import com.taobao.api.response.VasOrderSearchResponse;

import java.util.Date;

/**
 * Created with IntelliJ IDEA. <br/>
 * Author: wangming    <br/>
 * Date: 2014-06-04  <br/>
 */
public class VasOrderSearchReq extends AbstractReq<VasOrderSearchReq, VasOrderSearchResponse> {

    private String articleCode;
    private String itemCode;
    private String nick;
    private Date startCreated;
    private Date endCreated;
    private Long bizType;
    private Long bizOrderId;
    private Long orderId;
    private Long pageSize;
    private Long pageNo;


    public VasOrderSearchReq articleCode(String articleCode) {
        this.articleCode = articleCode;
        return this;
    }

    public VasOrderSearchReq itemCode(String itemCode) {
        this.itemCode = itemCode;
        return this;
    }

    public VasOrderSearchReq nick(String nick) {
        this.nick = nick;
        return this;
    }

    public VasOrderSearchReq startCreated(Date startCreated) {
        this.startCreated = startCreated;
        return this;
    }

    public VasOrderSearchReq endCreated(Date endCreated) {
        this.endCreated = endCreated;
        return this;
    }

    public VasOrderSearchReq bizType(Long bizType) {
        this.bizType = bizType;
        return this;
    }

    public VasOrderSearchReq bizOrderId(Long bizOrderId) {
        this.bizOrderId = bizOrderId;
        return this;
    }

    public VasOrderSearchReq orderId(Long orderId) {
        this.orderId = orderId;
        return this;
    }

    public VasOrderSearchReq pageSize(Long pageSize) {
        this.pageSize = pageSize;
        return this;
    }

    public VasOrderSearchReq pageNo(Long pageNo) {
        this.pageNo = pageNo;
        return this;
    }


    @Override
    protected TaobaoRequest toRequest() {
        VasOrderSearchRequest req = new VasOrderSearchRequest();
        if (null != articleCode) {
            req.setArticleCode(articleCode);
        }
        if (null != itemCode) {
            req.setItemCode(itemCode);
        }
        if (null != nick) {
            req.setNick(nick);
        }
        if (null != startCreated) {
            req.setStartCreated(startCreated);
        }
        if (null != endCreated) {
            req.setEndCreated(endCreated);
        }
        if (null != bizType) {
            req.setBizType(bizType);
        }
        if (null != bizOrderId) {
            req.setBizOrderId(bizOrderId);
        }
        if (null != orderId) {
            req.setOrderId(orderId);
        }
        if (null != pageSize) {
            req.setPageSize(pageSize);
        }
        if (null != pageNo) {
            req.setPageNo(pageNo);
        }
        return req;
    }
}
